<script>
import { ElsCollapseItem } from "../collapse";
import BaseNode from "../../mixins/node.js";
export default {
  props: {
    classNames: String,
  },
  mixins: [BaseNode],
  data() {
    return {
      activeNames: [],
    };
  },
  methods: {
    handleCommand(params, command) {
      if (command === "showhide") {
        params.handler();
      }
      // console.log("xxxx", params, command);
      // this.$message("click on item " + command);
      // return (command) => {
      //   console.log("xxxx", params, command);
      //   this.$message("click on item " + command);
      // };
    },
  },
  components: {
    ElsCollapseItem,
  },
};
</script>
<template>
  <els-collapse-item class="card-docker" :class="classNames" :name="id">
    <template #header="{ isActive, handler }">
      <div class="top-right-d"></div>
      <div class="custom-header">
        <div class="--left">
          <i class="iconfont icon-Check-Circle-Fill"></i>
          <span>{{ data.dockerName }}</span>
        </div>
        <div class="--right">
          <!-- <i class="icon fa fa-arrows" aria-hidden="true"></i> -->
          <!-- <i class="icon fa fa-circle-o-notch" aria-hidden="true"></i> -->
          <!-- <i class="icon fa fa-paper-plane" aria-hidden="true"></i> -->
          <i class="iconfont icon-fabusekuai"></i>
          <!-- <i class="iconfont icon-androidgengduo-copy"></i> -->
          <el-dropdown
            trigger="click"
            @command="
              (command) => handleCommand({ isActive, handler }, command)
            "
          >
            <i class="iconfont icon-androidgengduo-copy"></i>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="showhide">折叠/显示</el-dropdown-item>
              <el-dropdown-item>显示主刀分组</el-dropdown-item>
              <el-dropdown-item>清空手术护士</el-dropdown-item>
              <el-dropdown-item>清空麻醉医生</el-dropdown-item>
              <el-dropdown-item>清空体外循环</el-dropdown-item>
              <el-dropdown-item>清空手术安排</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <el-divider direction="vertical"></el-divider>
          <i
            @click="handler"
            class="iconfont els-collapse-item__arrow icon-down"
            :class="{ 'is-active': isActive }"
          ></i>
        </div>
      </div>
      <div class="custom-sub-header">
        <span>计划 {{ 200 }} 台 · 实际 {{ 130 }} 台</span>
      </div>
      <div
        class="sch-dot"
        :ref="dot.type"
        v-for="dot in dots"
        :class="`--${dot.type}`"
      ></div>
    </template>
    <div class="detail">
      <el-steps direction="vertical" :space="30" :active="3">
        <el-step icon="iconfont icon-Check-Circle-Fill">
          <div slot="title" class="step-content">
            <div class="step-left">
              <span>择期：共 {{ 100 }} 台 完成 {{ 100 }} 台</span>
            </div>
            <div class="step-right">
              <span>{{ "100%" }}</span>
            </div>
          </div>
        </el-step>
        <el-step icon="iconfont icon-jiazaiyuanhuan-ban">
          <div slot="title" class="step-content">
            <div class="step-left">
              <span>急诊：共 {{ 10 }} 台 完成 {{ 10 }} 台</span>
            </div>
            <div class="step-right">
              <span>{{ "100%" }}</span>
            </div>
          </div>
        </el-step>
        <el-step icon="iconfont icon-jiazaiyuanhuan-ban">
          <div slot="title" class="step-content">
            <div class="step-left">
              <span>日间：共 {{ 10 }} 台 完成 {{ 10 }} 台</span>
            </div>
            <div class="step-right">
              <span>{{ "50%" }}</span>
            </div>
          </div>
        </el-step>
        <el-step icon="iconfont icon-history">
          <div slot="title" class="step-content">
            <div class="step-left">
              <span>停台：无</span>
            </div>
            <div class="step-right">
              <span>{{ " " }}</span>
            </div>
          </div>
        </el-step>
      </el-steps>
    </div>
  </els-collapse-item>
</template>
<style scoped lang="less">
.card-docker {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
  line-height: 20px;
  transition: all 0.3s linear;
  &.is-active {
    // border: 1px solid rgba(22, 119, 255, 1);
    background: rgba(22, 122, 255, 0.09);
    .custom-header .--right {
      .iconfont.icon-fabusekuai {
        color: #30a46c;
      }
    }
  }
  ::v-deep .els-collapse-item__header {
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    position: relative;
    // top: -1px;
    // left: -1px;
    // width: calc(100% + 2px);
    transition: all 0.3s linear;
    padding: 8px;
    background: #fff;
    &.is-active {
      // background: #409eff29;
      // border-color: #1677ff;
      border-color: rgba(22, 119, 255, 1);
      background: rgba(22, 122, 255, 0.09);
      .els-collapse-item__arrow {
        margin-top: -2px;
        transform: rotate(180deg);
      }
      .top-right-d {
        opacity: 1;
      }
    }
  }
  .top-right-d {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    right: 1px;
    top: 1px;
    transition: opacity 0.3s linear;
    border-top-right-radius: 4px;
    border-top: 12px solid #1677ff;
    border-left: 12px solid transparent;
  }
  .custom-header {
    display: flex;
    align-items: center;
    padding-bottom: 2px;
    > .--left {
      flex: 1;
      font-size: 14px;
      display: flex;
      align-items: center;
      color: rgba(0, 0, 0, 0.85);
      .iconfont {
        color: #30a46c;
        margin-right: 5px;
      }
    }
    > .--right {
      display: flex;
      align-items: center;
      .iconfont {
        cursor: pointer;
        display: block;
        width: 16px;
        height: 20px;
        font-size: 14px;
        margin-right: 0;
        color: rgba(0, 0, 0, 0.45);
        &.icon-androidgengduo-copy {
          margin-left: 3px;
        }
      }
      ::v-deep .el-divider {
        color: rgba(0, 0, 0, 0.06);
        margin-left: 5px;
      }
    }
  }
  .custom-sub-header {
    color: rgba(0, 0, 0, 0.45);
  }
  .detail {
    padding: 8px;
    ::v-deep .el-step {
      &:last-child {
        flex-basis: 18px !important;
      }
      .el-step__head {
        width: 16px;
        &.is-finish {
          color: rgba(48, 164, 108, 1);
          border-color: rgba(48, 164, 108, 1);
        }
        &.is-process {
          color: rgba(0, 0, 0, 0.25);
          border-color: rgba(0, 0, 0, 0.25);
        }
        &.is-wait {
          color: rgba(0, 0, 0, 0.25);
          border-color: rgba(0, 0, 0, 0.25);
        }
      }
      .el-step__title {
        &.is-process {
          font-weight: normal;
        }
      }
      .el-step__line {
        left: 9px;
      }
      .el-step__icon {
        font-size: 14px;
        width: 20px;
        height: 20px;
        border-radius: 100%;
        background: #e7f1fe;
        padding: 3px;
      }
      .el-step__icon-inner {
        font-weight: unset;
        &.icon-Check-Circle-Fill {
          color: #30a46c;
        }
        &.icon-jiazaiyuanhuan-ban {
          color: #1677ff;
        }
      }
    }
    .step-content {
      display: flex;
      align-items: center;
      color: rgba(0, 0, 0, 0.65);
      line-height: 22px;
      font-size: 12px;
      > .step-left {
        flex: 1;
      }
      > .step-right {
        color: rgba(0, 0, 0, 0.45);
      }
    }
  }
}
</style>
